package level.editor.menu;

import level.editor.command.Command;
import level.editor.mediator.Mediator;
import level.editor.mediator.Module;
import level.editor.window.HasView;
import level.editor.window.Window;

/*
 * Implementation of the menu module. Responsible for commucating between the
 * menu view (the actual menu bar that responds to user inputs) and the
 * mediator, which will send commands to other modules.
 */

public class MenuModule extends Module implements HasView
{

	private MenuView view;

	public MenuModule(Mediator mediator)
	{
		super(mediator, "MenuModule");
		view = null;
	}
	
	@Override
	public void establishView(Window window)
	{
		MenuView view = new MenuView();
		view.registerModule(this);
		view.init(window);
		this.view = view;
	}
	
	@Override
	public void pushDownCommand(Command command)
	{
		view.pushDownCommand(command);
	}
	
}
